package com.day11.homework;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

public class Demo {
    private static final String FILE_NAME = "test.properties";

    public static void main(String[] args) {
        InputStream fileInputStream = null;
        try {
            fileInputStream = new FileInputStream(FILE_NAME);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        PropertyAnnotation config = PropertyFactory.readProp(fileInputStream);
        if (config == null) {
            System.out.println("读取失败");
        } else {
            PropertyModel pm = new PropertyModel(config.getUrl(), config.getUsername(), config.getPassword());
            System.out.println(pm.toString());
        }
    }
}
